bitkeeper revision 1.1236.31.3 (42376f62DcjuC-_BFPp328kWnfyo1w)
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Tue, 15 Mar 2005 23:27:30 +0000 (23:27 +0000)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Tue, 15 Mar 2005 23:27:30 +0000 (23:27 +0000)
Fix uninitialized variable causing early NaT fault

.rootkeys
xen/arch/ia64/domain.c
xen/arch/ia64/process.c
xen/arch/ia64/tools/README.xenia64linux [new file with mode: 0644]
xen/arch/ia64/vcpu.c
xen/arch/ia64/xenmisc.c
xen/include/asm-ia64/config.h

index 2986ce0696809abeddd67804e96dbfd5b188dc95..169081eaca302184827503ef552c07dada7cae91 100644 (file)
--- a/.rootkeys
+++ b/.rootkeys
 421098b69pUiIJrqu_w0JMUnZ2uc2A xen/arch/ia64/smp.c
 421098b6_ToSGrf6Pk1Uwg5aMAIBxg xen/arch/ia64/smpboot.c
 421098b6AUdbxR3wyn1ATcmNuTao_Q xen/arch/ia64/tools/README.xenia64
+42376c6dfyY0eq8MS2dK3BW2rFuEGg xen/arch/ia64/tools/README.xenia64linux
 421098b6rQ2BQ103qu1n1HNofbS2Og xen/arch/ia64/tools/mkbuildtree
 41a26ebc--sjlYZQxmIxyCx3jw70qA xen/arch/ia64/vcpu.c
 421098b6M2WhsJ_ZMzFamAQcdc5gzw xen/arch/ia64/vhpt.c
index 82fe694e888265fd886675fe0fac3b61bf581acc..b070541751f1210a995627544361ffd88a790d08 100644 (file)
@@ -248,6 +248,7 @@ void new_thread(struct exec_domain *ed,
        regs->pr = 0;
        sw->pr = 0;
        regs->ar_pfs = 0;
+       sw->caller_unat = 0;
        sw->ar_pfs = 0;
        sw->ar_bspstore = new_rbs;
        //regs->r13 = (unsigned long) ed;
index 08fd4d0c545fa446b6f02b31078bdea6329dccdf..c2148c4662b28f40609a6b7defd2efca59fa9b9a 100644 (file)
@@ -204,10 +204,11 @@ void deliver_pending_interrupt(struct pt_regs *regs)
        struct exec_domain *ed = current;
        // FIXME: Will this work properly if doing an RFI???
        if (!is_idle_task(d) && user_mode(regs)) {
-               vcpu_poke_timer(ed);
+               //vcpu_poke_timer(ed);
                if (vcpu_deliverable_interrupts(ed)) {
                        unsigned long isr = regs->cr_ipsr & IA64_PSR_RI;
-                       foodpi();
+                       if (vcpu_timer_pending_early(ed))
+printf("*#*#*#* about to deliver early timer to domain %d!!!\n",ed->domain->id);
                        reflect_interruption(0,isr,0,regs,IA64_EXTINT_VECTOR);
                }
        }
diff --git a/xen/arch/ia64/tools/README.xenia64linux b/xen/arch/ia64/tools/README.xenia64linux
new file mode 100644 (file)
index 0000000..ab69442
--- /dev/null
@@ -0,0 +1,50 @@
+INSTRUCTIONS FOR BUILDING XENLINUX/IA64
+
+1) In linux-2.6.9: (also tested with 2.6.10, 2.6.11.2)
+       cp arch/ia64/configs/zx1_defconfig .config
+2) vi .config
+       unset CONFIG_IA32_SUPPORT
+       unset CONFIG_IDE [for now, need to fix later]
+       unset CONFIG_VIRTUAL_MEM_MAP [for now, need to fix later]
+       set CONFIG_DISABLE_VHPT
+3) if running on ski, it is useful to make the following change:
+   a) at the beginning of drivers/acpi/motherboard.c:acpi_reserve_resources()
+      add the line:
+       if (!acpi_gbl_FADT) return;
+4) Build linux.
+   a) yes "" | make oldconfig
+   b) check the resulting .config to ensure there are no modules used (because
+      Xen/ia64 doesn't support them yet).  Change '=m' to '=n' and remake
+   c) yes "" | make oldconfig
+   d) make
+5) Linux must be "privified" to run on Xen/ia64.  This process converts all
+   privilege-sensitive instructions into privileged instructions.
+       Usage: privify infile outfile
+   Privify is very dumb... it will not overwrite outfile.  It also prints
+   out a bunch of useless info that can be safely ignored (except for "panic").
+   The privify program can be obtained from:
+       ftp://ftp.hpl.hp.com/pub/xen-ia64/privify
+6) debug fixes:
+   a) periodically xenlinux/ia64 goes into a fit of printing
+      "Oops: timer tick before it is due..."  This can be changed
+      in arch/ia64/kernel/time.c to either ignore it or print something
+      shorter
+   b) The hp simulator (ski) console drivers can be turned on to allow
+      output of early boot information from xenlinux.  This results
+      in some duplication of later output (which can be ignored).
+      i) in linux/arch/ia64/Makefile, force the sim drivers by changing
+               drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim to
+               drivers-y += arch/ia64/hp/sim
+      ii) in linux/arch/ia64/hp/sim/Makefile, force the sim drivers
+         by changing obj-$(CONFIG_HP_SIMSERIAL) to obj-y and
+          obj-$(CONFIG_HP_SIM_SERIAL_CONSOLE) to obj-y
+      iii) in arch/ia64/kernel/setup.c:early_console_setup(), replace
+           the contents of the routine with:
+               extern struct console hpsim_cons;
+               register_console(&hpsim_cons);
+               return 0;
+           (It may be necessary also to un-inline the routine, not sure.)
+   c) It can be useful to modify linux/init/main.c to add a printf before
+      or after a lot of the init calls
+6) NOTE: mca currently has a problem with binary translation,
+   must run with "nomca" as a kernel argument
index c0ab341b82f2a5e7c8e5437686645b26914191ce..f37aa1ab279c2caa2f669612512fdb0efcdc3a9a 100644 (file)
@@ -572,6 +572,12 @@ UINT64 vcpu_deliverable_interrupts(VCPU *vcpu)
                vcpu_check_pending_interrupts(vcpu) != SPURIOUS_VECTOR);
 }
 
+UINT64 vcpu_deliverable_timer(VCPU *vcpu)
+{
+       return (vcpu_get_psr_i(vcpu) &&
+               vcpu_check_pending_interrupts(vcpu) == PSCB(vcpu,itv));
+}
+
 IA64FAULT vcpu_get_lid(VCPU *vcpu, UINT64 *pval)
 {
 extern unsigned long privop_trace;
@@ -950,9 +956,28 @@ void vcpu_pend_timer(VCPU *vcpu)
        UINT64 itv = PSCB(vcpu,itv) & 0xff;
 
        if (vcpu_timer_disabled(vcpu)) return;
+#if 1
+       // attempt to flag "timer tick before its due" source
+       {
+       UINT64 itm = PSCB(vcpu,domain_itm);
+       UINT64 now = ia64_get_itc();
+       if (now < itm) printf("******* vcpu_pend_timer: pending before due!\n");
+       }
+#endif
        vcpu_pend_interrupt(vcpu, itv);
 }
 
+// returns true if ready to deliver a timer interrupt too early
+UINT64 vcpu_timer_pending_early(VCPU *vcpu)
+{
+       UINT64 now = ia64_get_itc();
+       UINT64 itm = PSCB(vcpu,domain_itm);
+
+       if (vcpu_timer_disabled(vcpu)) return 0;
+       if (!itm) return 0;
+       return (vcpu_deliverable_timer(vcpu) && (now < itm));
+}
+
 //FIXME: This is a hack because everything dies if a timer tick is lost
 void vcpu_poke_timer(VCPU *vcpu)
 {
@@ -974,7 +999,7 @@ void vcpu_poke_timer(VCPU *vcpu)
                        if (irr & (1L<<(0xef-0xc0))) return;
 if (now-itm>0x800000)
 printf("*** poking timer: now=%lx,vitm=%lx,xitm=%lx,itm=%lx\n",now,itm,local_cpu_data->itm_next,ia64_get_itm());
-                       vcpu_pend_interrupt(vcpu, 0xefL);
+                       vcpu_pend_timer(vcpu);
                }
        }
 }
index 7f215470a8ac9c0f89b61bcf2dc02016781124d6..fe4de437e288b60b8fe94cd511898b48082518b0 100644 (file)
@@ -257,6 +257,7 @@ void context_switch(struct exec_domain *prev, struct exec_domain *next)
        //if (!is_idle_task(next->domain) )
                //send_guest_virq(next, VIRQ_TIMER);
        load_region_regs(current);
+       if (vcpu_timer_expired(current)) vcpu_pend_timer(current);
 }
 
 void panic_domain(struct pt_regs *regs, const char *fmt, ...)
@@ -276,5 +277,6 @@ void panic_domain(struct pt_regs *regs, const char *fmt, ...)
        printf(buf);
        if (regs) show_registers(regs);
        domain_pause_by_systemcontroller(current->domain);
+       set_bit(DF_CRASHED, ed->domain->d_flags);
        //while(test);
 }
index d7d29fd454a164cfd62d662f797d06816d0bf691..ed6568bc0912a0fdeceeb021b4b73a33fbfcf64a 100644 (file)
@@ -1,7 +1,6 @@
 // control flags for turning on/off features under test
 #undef CLONE_DOMAIN0
-//#define CLONE_DOMAIN0 3
-#define USER_ACCESS
+//#define CLONE_DOMAIN0 1
 
 // manufactured from component pieces